<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>掌上兴农</title>
		<script src="__INDEX__/tem/js/mui.min.js"></script>
		<link href="__INDEX__/tem/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/tem/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/tem/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/tem/css/xn.css" />

		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">掌上兴农</h1>
			<a class="mui-icon mui-icon-help mui-pull-right" href="{:url('help/help',['fid'=>'3'])}"></a>
		</header>
		<div class="mui-content">
			<div id="slider" class="mui-slider">
				<div class="mui-slider-group mui-slider-loop">
					<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a href="{:url('index/loan')}">
							<img src="__INDEX__/images/ad/index/3.png">
						</a>
					</div>
					<!-- 第一张 -->
					<div class="mui-slider-item">
						<a href="{:url('member/dingyue')}">
							<img src="__INDEX__/images/ad/index/1.jpg">
						</a>
					</div>
					<!-- 第二张 -->
					<div class="mui-slider-item">
						<a href="#">
							<img src="__INDEX__/images/ad/index/2.png">
						</a>
					</div>
					<!-- 第三张 -->
					<div class="mui-slider-item">
						<a href="{:url('index/loan')}">
							<img src="__INDEX__/images/ad/index/3.png">
						</a>
					</div>
					<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a href="{:url('member/dingyue')}">
							<img src="__INDEX__/images/ad/index/1.jpg">
						</a>
					</div>
				</div>
				<div class="mui-slider-indicator">
					<div class="mui-indicator mui-active"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
				</div>
			</div>
			<div class="shengczbox">
				<div class="scz_top">
					<div class="left">
						<div class="index_bt"><span>生产者发布</span></div>
						<p>用于发布信息</p>
					</div>
					<div class="right">
						<ul class="mui-table-view mui-grid-view mui-grid-9 scznav">
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('member/product_add')}">
									<span class="mui-icon iconfont icon-shengchan"></span>
									<div class="mui-media-body">生产大数据</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('member/machine')}">
									<span class="mui-icon iconfont icon-nongji"></span>
									<div class="mui-media-body">农机大数据</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('member/people_add')}">
									<span class="mui-icon iconfont icon-rcfz"></span>
									<div class="mui-media-body">人才大数据</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('member/farmstay')}">
									<span class="mui-icon iconfont icon-nongjiale"></span>
									<div class="mui-media-body">农家乐大数据</div>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="scz_bottom">
					<div class="bt">教程指导</div>
					<div class="sczb_con clearfix">
						<div class="left">
							<ul class="mui-table-view mui-grid-view mui-grid-9">
								<li class="mui-table-view-cell mui-media">
									<a href="{:url('help/help_show',['id'=>129])}">
										<span class="mui-icon iconfont icon-signin"></span>
										<div class="mui-media-body">会员登录</div>
									</a>
								</li>
								<li class="mui-table-view-cell mui-media">
									<a href="{:url('help/help_show',['id'=>119])}">
										<span class="mui-icon iconfont icon-zhuce"></span>
										<div class="mui-media-body">会员注册</div>
									</a>
								</li>
								<li class="mui-table-view-cell mui-media">
									<a href="{:url('help/help_show',['id'=>128])}">
										<span class="mui-icon iconfont icon-zhaohuimima"></span>
										<div class="mui-media-body">找回密码</div>
									</a>
								</li>
								<li class="mui-table-view-cell mui-media">
									<a href="{:url('help/help_show',['id'=>127])}">
										<span class="mui-icon iconfont icon-dingyue"></span>
										<div class="mui-media-body">订阅杂志</div>
									</a>
								</li>
							</ul>
						</div>
						<div class="right">
							<a href="{:url('help/help_show',['id'=>122])}">
								<div class="jiaocr">
									<div class="bt">发布生产大数据教程</div>
									<div class="nr">发布产品之前,首先要发布生产者大数据，这样就有了一个主体，要不客户找不到您。</div>
									<div class="time clearfix">
										<span>电话咨询：0735-5888188</span>
									</div>
								</div>
							</a>
						</div>
					</div>
				</div>
			</div>
			<div class="shengczbox">
				<div class="scz_top xfz_top">
					<div class="left xfz_left">
						<a href="{:url('product/index')}">
							<div class="index_bt"><span>找农产品</span></div>
							<p>用于查询信息</p>
						</a>
					</div>
					<div class="right">
						<ul class="mui-table-view mui-grid-view mui-grid-9 xfznav">
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('people/index')}">
									<span class="mui-icon iconfont icon-zhaoren"></span>
									<div class="mui-media-body">找人才</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('machine/index')}">
									<span class="mui-icon iconfont icon-zhaoche"></span>
									<div class="mui-media-body">找农机</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('farmstay/index')}">
									<span class="mui-icon iconfont icon-gongyuzhaofang"></span>
									<div class="mui-media-body">找农家乐</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('otherdata/lists')}">
									<span class="mui-icon iconfont icon-gongyuzhaofang"></span>
									<div class="mui-media-body">找其它</div>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<ul class="xfz_ul clearfix">
					{volist name="product" id="vo"}
					<li>
						<a href="{:url('product/show',['id'=>$vo.id])}">
							<div class="img"><img src="{$vo.thumb|default='__INDEX__/tem/images/cp.jpg'}" style="width: 109px;height: 96px;"></div>
							<div class="nam">{$vo.name}</div>
						</a>
					</li>
					{/volist}
				</ul>
			</div>
			<div class="ad"><img src="__INDEX__/tem/images/ad2.jpg"></div>
			<div class="shengczbox qbzbox">
				<div class="scz_top xfz_top">
					<div class="left qbz_left">
						<a href="{:url('news/index')}">
							<div class="index_bt"><span>农技电<br/>子杂志</span></div>
							<p>查看订阅信息</p>
						</a>
					</div>
					<div class="right">
						<ul class="mui-table-view mui-grid-view mui-grid-9 xfznav">
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('news/zcnews')}">
									<span class="mui-icon iconfont icon-zhengce"></span>
									<div class="mui-media-body">政策信息</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('news/jsnews')}">
									<span class="mui-icon iconfont icon-xiuli"></span>
									<div class="mui-media-body">技术信息</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('news/jgnews')}">
									<span class="mui-icon iconfont icon-yen"></span>
									<div class="mui-media-body">价格信息</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media">
								<a href="{:url('news/shnews')}">
									<span class="mui-icon iconfont icon-shenghuo"></span>
									<div class="mui-media-body">生活信息</div>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="qbz_bottom">
					<div class="qbz_btop">
						<div class="left"><img src="__INDEX__/tem/images/rdbt.jpg"></div>
						<div class="right">
							<div class="xfz_new">
								<a href="{:url('news/news_show',['id'=>$newstop1.id])}">
									<span class="tip">最新</span>
									<span>{$newstop1.title|mb_substr=0,17,'UTF-8'}</span>
								</a>
							</div>
							<div class="xfz_new hot">
								<a href="{:url('news/news_show',['id'=>$newstop2.id])}">
									<span class="tip">最热</span>
									<span>{$newstop2.title|mb_substr=0,17,'UTF-8'}</span>
								</a>
							</div>
						</div>
					</div>
					<ul class="qbz_ul">
						{volist name="news" id="vo"}
						<li>
							<a href="{:url('news/news_show',['id'=>$vo.id])}">
								<div class="name"><em>[{switch name="$vo.type" }
									    {case value="1"}生活{/case}
									    {case value="2"}价格{/case}
									    {case value="3"}政策{/case}
									    {default /}技术{/switch}]</em>{$vo.title|mb_substr=0,80,'UTF-8'}</div>
								<div class="timebox">
									<span><em class="iconfont icon-yanjing"></em>订阅信息</span>
									<span><em class="iconfont icon-dianzan"></em>{$vo.clicks}</span>
									<span class="time">{$vo.add_time|substr=0,10}</span>
								</div>
							</a>
						</li>
						{/volist}
					</ul>
				</div>
			</div>
			<div class="ad"><img src="__INDEX__/tem/images/ad3.jpg"></div>
			<div class="shengczbox">
				<div class="scz_top video_top">
					<div class="left">
						<a href="{:url('college/vedio')}">
							<div class="index_bt"><span>视频<br/>中心</span></div>
							<p>精选视频推荐</p>
						</a>
					</div>
					<div class="right">
						<ul class="video_ul">
							<li>
								<a href="{:url('college/vedio',['type'=>1])}">
									<div class="nambox" style="width: 79%; float: left;">
										<div class="vidbt">农技视频</div>
										<div class="vidnam">走进农业技术</div>
									</div>
									<div class="vidbox" style="width: 20%;float: right;"><img src="__INDEX__/tem/images/cp.jpg"></div>
								</a>
							</li>
							<li>
								<a href="{:url('college/vedio',['type'=>2])}">
									<div class="nambox" style="width: 79%; float: left;">
										<div class="vidbt hot">新农人视频</div>
										<div class="vidnam">走进新农人</div>
									</div>
									<div class="vidbox" style="width: 20%;float: right;"><img src="__INDEX__/tem/images/cp.jpg"></div>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<ul class="xfz_ul clearfix">
					{volist name="list" id="vo" empty="没有数据"}
					<li>
						<a href="{:url('college/vedio_show',['id'=>$vo.id])}">
							<div class="img"><img src="{$vo.thumb|default='__IMG__/logo1.png'}" style="width: 109px;height: 96px;"></div>
							<div class="nam">{$vo.title}</div>
						</a>
					</li>
					{/volist}
				</ul>
			</div>
			<div class="shengczbox">
				<div class="scz_top video_top">
					<div class="left">
						<a href="{:url('college/sxy',['fid'=>2])}">
							<div class="index_bt" style="background-color:#006666;"><span>电商<br/>知识</span></div>
							<p>精选电商推荐</p>
						</a>
					</div>
					<div class="right">
						<ul class="video_ul">
							<li>
								<a href="{:url('college/sxy',['fid'=>2])}">
									<div class="nambox" style="width: 79%; float: left;">
										<div class="vidbt">最新推荐</div>
										<div class="vidnam">掌上兴农--走进电商</div>
									</div>
									<div class="vidbox" style="width: 20%;float: right;"><img src="__INDEX__/tem/images/cp.jpg"></div>
								</a>
							</li>
							<li>
								<a href="{:url('ask/add')}">
									<div class="nambox" style="width: 79%; float: left;">
										<div class="vidbt hot">专家咨询</div>
										<div class="vidnam">点击进入咨询</div>
									</div>
									<div class="vidbox" style="width: 20%;float: right;"><img src="__INDEX__/tem/images/cp.jpg"></div>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<ul class="xfz_ul clearfix">
					{volist name="sxy" id="vo" empty="没有数据"}
					<li>
						<a href="{:url('college/sxy_show',['id'=>$vo.id])}">
							<div class="img"><img src="{$vo.thumb|default='__IMG__/logo1.png'}" style="width: 109px;height: 96px;"></div>
							<div class="nam">{$vo.title}</div>
						</a>
					</li>
					{/volist}
				</ul>
			</div>
			<div class="shengczbox">
				<div class="scz_top video_top">
					<div class="left zjzx_left">
						<a href="{:url('college/expert')}">
							<div class="index_bt"><span>专家<br/>团队</span></div>
							<p>专家风采</p>
						</a>
					</div>
					<div class="right">
						<ul class="zjwd_ul clearfix">
							{volist name="expert" id="vo" empty="没有数据"}
							<li>
								<a href="{:url('college/expert_show',['id'=>$vo.id])}">
									<div class="zjimgbox">
										<div class="zjimg"><img src="{$vo.thumb|default='__IMG__/logo1.png'}"></div>
										<div class="zjnambox">
											<p class="name">{$vo.name}<em>专家</em></p>
											<p class="year">从业<em>{$vo.work_year}</em>年</p>
										</div>
									</div>
									<div class="zjjs">{$vo.professional|mb_substr=0,17,'UTF-8'}</div>
								</a>
							</li>
							{/volist}
						</ul>
					</div>
				</div>
				<div id='askdiv'>
					{foreach name='ask' id='vo'}
					<div class="zjwd_item">
						<a href="{:url('ask/show',['id'=>$vo.id])}">
							<div class="zjtw_imgbox">
								<div class="zjtw_img"><img src="{$vo.thumb|default='__IMG__/logo1.png'}"></div>
								<div class="zjtw_nambox">
									<p class="name"><em>{$vo.nick_name|default='未填写昵称'}</em>问：</p>
									<p class="time">{$vo.add_time|substr=0,10}</p>
								</div>
							</div>
							<div class="zjtw_nrbox">
								<div class="zjtw_wt">{$vo.content}</div>
								<div class="zjtw_wtimg">
									{php}$imgs=explode(',', $vo['thumbs']);{/php} {if $vo.thumbs}{foreach name='imgs' id='img'}
									<img src="{$img}" /> {/foreach}{/if}
								</div>
								<div class="zjtw_hfbox">
									<span class="tip">标签：{$vo.hy_id|get_newscate}</span>
									<span class="huif" style="margin-left: 10px;"><em class="iconfont icon-xiaoxi"></em>{$vo.replys}</span>
									<span class="huif"><em class="iconfont icon-yanjing"></em>{$vo.clicks}</span>
								</div>
							</div>
						</a>
					</div>
					{/foreach}
				</div>
			</div>

		</div>
		<nav class="mui-bar mui-bar-tab xn_bar" id="footer-list">
			<a class="mui-tab-item mui-active" href="{:url('index/index')}">
				<span class="mui-icon  iconfont icon-shouye"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" href="{:url('news/index')}">
				<span class="mui-icon iconfont icon-tangxueyuan"></span>
				<span class="mui-tab-label">农技杂志</span>
			</a>
			<a class="mui-tab-item" href="{:url('college/index')}">
				<span class="mui-icon iconfont icon-tangxueyuan"></span>
				<span class="mui-tab-label">农民党校</span>
			</a>
			<a class="mui-tab-item" href="{:url('goods/index')}">
				<span class="mui-icon iconfont icon-taonongzi1"></span>
				<span class="mui-tab-label">农资采购</span>
			</a>
			<a class="mui-tab-item" href="{:url('member/index')}">
				<span class="mui-icon iconfont icon-huiyuanzhongxin"></span>
				<span class="mui-tab-label">会员中心</span>
			</a>
		</nav>
		<div style="position: fixed;right: 10px; bottom: 100px;filter:alpha(Opacity=50);-moz-opacity:0.8;opacity: 0.8; width: 35px;padding-top: 2px; height: 35px;background: #008000; text-align: center;line-height: 14px;font-size: 9px;">
			<a href="{:url('ask/add')}" style="color: #FFFFFF;">咨询<br />专家</a>
		</div>
		<div style="position: fixed;right: 10px; bottom: 60px;filter:alpha(Opacity=50);-moz-opacity:0.8;opacity: 0.8; width: 35px;padding-top: 2px; height: 35px;background: #008000; text-align: center;line-height: 14px;font-size: 9px;">
			<a href="{:url('help/help',['fid'=>'3'])}" style="color: #FFFFFF;">帮助<br />教程</a>
		</div>
	</body>
	<script src="__JS__/jquery.min.js"></script>
	<script src="__LIB__/layer.js"></script>
	<script src="__JS__/index.js"></script>
	<script>
		var aniShow = "pop-in";
		//页面跳转
		mui('#footer-list').on('tap', 'a', function() {
			var id = this.getAttribute('href');
			var href = this.href;
			mui.openWindow({
				id: id,
				url: this.href,
				show: {
					aniShow: aniShow
				},
				waiting: {
					autoShow: false
				}
			});
		});
		var gallery = mui('.mui-slider');
		gallery.slider({
			interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
		});

		var page = 2;
		//一开始显示数据
		//实际中应该是将分页的效果做成加载更多的效果 但是调取数据的原理 是一样的 就是显示数据的效果不一样
		$(document).scroll(function() {
			//滚动条滑动的时候获取滚动条距离顶部的距离
			var scroll = $(document).scrollTop();
			//屏幕的高度
			var client = $(window).height();
			var h = $(document).height();
			var flag = true;
			if(h <= scroll + client) { // 到达底部时,加载新内容
				if(flag == false) {
					return;
				}
				do_ajax(page);
				page++;
				//alert("需要加载数据了!");
			}
		});

		function do_ajax(page) {

			$.ajax({
				url: "{:url('ajax_asklist')}",
				type: 'GET',
				data: {
					page: page
				},
				success: function(json) {

					if(json.code == 1) {

						for(var i = 0; i < json.data.length; i++) {
							var imgs = '';
							if(json.data[i].thumb) {
								imgs = '<img src="' + json.data[i].thumb + '">';
							} else {
								imgs = '<img src="__IMG__/logo1.png">';
							}

							var imgsArr = '';
							if(json.data[i].thumbs) {
								var thumbsArr = json.data[i].thumbs.split(',');
								for(var j = 0; j < thumbsArr.length; j++) {
									imgsArr += '<img src="' + thumbsArr[j] + '">';
								}
							}

							var nick_name_ = '';
							if(json.data[i].nick_name) {
								nick_name_ = json.data[i].nick_name;
							} else {
								nick_name_ = "未填写昵称";
							}

							var str = '<div class="zjwd_item">' +
								'<a href="/index/ask/show/id/' + json.data[i].id + '">' +
								'<div class="zjtw_imgbox">' +
								'<div class="zjtw_img">' + imgs + '</div>' +
								'<div class="zjtw_nambox">' +
								'<p class="name"><em>' + nick_name_ + '</em>问：</p>' +
								'<p class="time">' + json.data[i].add_time + '</p>' +
								'</div>' +
								'</div>' +
								'<div class="zjtw_nrbox">' +
								'<div class="zjtw_wt">' + json.data[i].content + '</div>' +
								'<div class="zjtw_wtimg">' + imgsArr +
								'</div>' +
								'<div class="zjtw_hfbox">' +
								'<span class="tip">标签：' + '{:get_newscate(' + json.data[i].hy_id + ')}' +'</span>'+
								'<span class="huif" style="margin-left: 10px;"><em class="iconfont icon-xiaoxi"></em>' + json.data[i].replys + '</span>' +
								'<span class="huif"><em class="iconfont icon-yanjing"></em>' + json.data[i].clicks + '</span>' +
								'</div>' +
								'</div>' +
								'</a>' +
								'</div>';
							$("#askdiv").append(str);
						}
					} else {
						layer.msg(json.msg);
					}
				}
			});
		}
	</script>

</html>